<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0" />
		<title>广告详情</title>
		<link rel="stylesheet" href="css/base.css" />
		<link rel="stylesheet" href="css/all.css" />
		<link rel="stylesheet" href="css/advertising-details.css" />
	</head>
	<style type="text/css">
		#middles img,
		div,
		p,
		table,
		ul,
		li,
		tr,
		td {
			max-width: 100% !important;
		}
		
		img {
			max-width: 100% !important;
		}
		
		#middles {
			overflow-x: hidden;
			width: 100%;
		}
		
		#middles div,
		#middles p,
		#middles ul,
		#middles li,
		#middles tr,
		#middles td,
		#middles input {
			line-height: .4rem !important;
			font-size: .3rem !important;
		}
	</style>

	<body>
		<div>
			<div class="heads">
				<span href="javascript:;" onclick="go()"><img src="img/zuojiantou.png" alt="" class="arrows"></span>
				<h1 class="titles">广告详情</h1>
				<a href=""><img src="img/xiang.png" alt="" class="certains"></a>
			</div>
			<div class="middles" id="middles">
				
					<div class="hongbao">
						<img src="img/hongbao.png" alt="">
					</div>
				
				<div class="content-big">
					<!--<p class="content-one">女人25岁以后为什么容易发胖？</p>-->
					<!--<p class="content-two">十来岁的时候，偶尔暴饮暴食胖了，饿个几天就瘦回来了；20岁后，只是正常吃喝也在不知不觉发胖；更可怕的是：25岁或者生了宝宝以后，真是说胖就胖，想瘦却瘦不了！特别是那些天生易胖体质的人，喝口水也能胖个2-3斤！</p>
            <div class="content-three">
                <img src="img/500727284.png" alt="">
            </div>
            <p class="content-two">但是，不是很多优质女性还是瘦瘦美美的吗？比如那些女星、网红、身边那些家庭美满、事业有成、年轻貌美的小姐姐……她们是如何避免“说胖就胖”的呢？ </p>
            <div class="content-three">
                <img src="img/500431626.png" alt="">
            </div>
            <p class="content-two">那怎么知道自己适不适合呢？都先别慌，美式排油减肥老师说了：可以来做个测试，就知道答案啦！（友情提示：符合条件的胖友，最后会显示减肥老师个人微信哦！加上老师微信，体验新式排油减肥，瘦瘦美美就是你！）</p>-->
				</div>
			</div>
		</div>
		<script src="js/x_rem.js"></script>
		<script src="js/jquery.js"></script>
		<script src="js/secondLevel.js"></script>
		<script src="js/all.js"></script>
		<script>
			(() => {
				var id = GetQueryString("id");
				var isReceive;    //判断任务是否完成
				
				
				console.log(id);
				//获取广告详情
				$.ajax({
					type: "post",
					url: Url + "/browseTask/findOneBrowseTask",
					xhrFields: {
						withCredentials: true
					},
					data: {
						browseTaskId: id
					},
					success: ((data) => {
						id = "";
						console.log(data);
						var html = "";
						html += `
						<h1 class="content-one">${data.message.browseTask.title}</h1>
 
			        	${data.message.browseTask.body}
					`
						$(".content-big").html(html);
						
						isReceive = data.message.isReceive;   //判断是否录取红包
						
						if(isReceive){  //如果对于true
							$(".hongbao").hide();  //红包隐藏
						}
						
					}),
					error: ((err) => {
						console.log(err);
					})
				});

				//点击红包

				$(".hongbao").click(() => {
					console.log(GetQueryString("id"));
					 if(isReceive){
					 	popup("您已领过红包");	
					 }else{
					 	$.ajax({
					 		type:"post",
					 		url:Url+"/browseTask/getMoney",
					 		xhrFields: {
								withCredentials: true
							},
							data:{
								"browseTaskId": GetQueryString("id")
							},
							success:((data)=>{
								console.log(data);
								if(data.success){
									popup("你领取了"+data.message+"元");
									$(".hongbao").hide();  //红包隐藏
								}else{
									popup(data.message);
								}
							}),
							error:((err)=>{
								console.log(err);
							})
					 	});
					 	
					 	
					 }
					 
					 
					 
				})

			})()
		</script>
	</body>

</html>